public class LinkedList {
 
	 private Node start;
	 
	 public LinkedList() {
		 setStart(null);
	 }
	 
	 public void insert(int x) {
		  if(getStart() == null) {
			  setStart(new Node(x, getStart()));
		  } else {  
			  Node temp = getStart();
		   
			  while(temp.getNext() != null) {
				  temp = temp.getNext();
			  }
			  Node newNode = new Node(x,null);
			  temp.setNext(newNode);
		  }
	 }
	 
	 
	 public void delete(int x) {
		  Node previous =  getStart();
		  Node temp = getStart();
		  
		  while(temp.getData() != x) {
			   if(temp.getNext() == null) {
			    System.out.println("\nElement "+ x + " not found !");
			    break;
		   }
		   
		   previous = temp;
		   temp = temp.getNext();
		 
		  }
		  if(temp == getStart()) {
			  setStart(getStart().getNext());
		  } else {
			  previous.setNext(temp);
		  }
	}
	
	public boolean isPresent(int n){
		Node temp = start;
		boolean present = true;
		while(temp.getData() != n) {
			if(temp.getNext() == null) {
			    present = false;
				break;
			}
		}
		return present;
	}

	public Node getStart() {
		return start;
	}

	public void setStart(Node start) {
		this.start = start;
	}
}